home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / general / plotting / imagetoo / imagetl1.lha / Imagetool / HDF / dfi.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-09-20  |  18.2 KB  |  507 lines

  1. /* cat > headers/dfsun.h << "EOF" */
  2. /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
  3. /* dfsun.h: include file to specify Sun hardware when    */
  4. /*        building the HDF library for ImageTool 1.1.    */
  5. /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
  6. /* SCCS information: %W%    %G% */
  7.  
  8. #if sun
  9. #if i386 || i486
  10. #define SUN386
  11. #elif mc68000 || mc68010 || mc68020 || mc68030 || sparc
  12. #define SUN
  13. #endif
  14. #endif
  15. /* EOF */
  16. /*****************************************************************************
  17. *              NCSA HDF version 3.10
  18. *                July 1, 1990
  19. *
  20. * NCSA HDF Version 3.10 source code and documentation are in the public
  21. * domain.  Specifically, we give to the public domain all rights for future
  22. * licensing of the source code, all resale rights, and all publishing rights.
  23. * We ask, but do not require, that the following message be included in all
  24. * derived works:
  25. * Portions developed at the National Center for Supercomputing Applications at
  26. * the University of Illinois at Urbana-Champaign.
  27. * THE UNIVERSITY OF ILLINOIS GIVES NO WARRANTY, EXPRESSED OR IMPLIED, FOR THE
  28. * SOFTWARE AND/OR DOCUMENTATION PROVIDED, INCLUDING, WITHOUT LIMITATION,
  29. * WARRANTY OF MERCHANTABILITY AND WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE
  30. *****************************************************************************/
  31.  
  32. #ifdef RCSID
  33. static char RcsId[] = "@(#)$Revision: 3.7 $"
  34. #endif
  35. /*
  36. $Header: /pita/work/HDF/dev/RCS/src/dfi.h,v 3.7 90/06/28 09:41:26 clow beta $
  37. $Log:    dfi.h,v $
  38.  * Revision 3.7  90/06/28  09:41:26  clow
  39.  * Added segment for APOLLO machines
  40.  * 
  41.  * Revision 3.6  90/05/23  15:47:37  clow
  42.  * added MACRO "DF_OPENERR" to give uniform error open checking,
  43.  * especially for unbufferred I/O open
  44.  * 
  45.  * Revision 3.5  90/05/18  11:09:12  clow
  46.  * added missing #endif
  47.  * 
  48.  * Revision 3.4  90/05/17  17:06:00  clow
  49.  * added _fcd and _fcdtocp for LS FORTRAN so we don't have to go through
  50.  * an extra layer of Fortran stubs
  51.  * 
  52.  * Revision 3.4  90/05/17  16:04:14  clow
  53.  * added _fcd and _fcdtocp for LS FORTRAN so we don't have to go through
  54.  * an extra layer of Fortran stubs
  55.  * 
  56.  * Revision 3.3  90/05/14  23:15:45  clow
  57.  * added definition of MACRO "FCALLKEYW"
  58.  * 
  59. */
  60. /*-----------------------------------------------------------------------------
  61.  * File:    dfi.h
  62.  * Purpose: HDF internal header file
  63.  * Invokes: stdio.h, sys/file.h
  64.  * Contents: 
  65.  *  Compilation parameters
  66.  *  Machine-dependent definitions
  67.  *  Flexibility definitions: i/o buffering, dynamic memory, structure i/o
  68.  *  Size parameters
  69.  * Remarks: To port to a new system, only dfi.h and Makefile need be modified.
  70.  *          This file is included with user programs, but users do not see it.
  71.  *---------------------------------------------------------------------------*/
  72.  
  73.  
  74. #ifndef DF_MAGICK        /* avoid re-inclusion */
  75.  
  76. #define    DF_MAGICK    "\016\003\023\001" /* ^N^C^S^A */
  77.  
  78. #ifndef FILE
  79. #include <stdio.h>
  80. #endif /*FILE*/
  81.  
  82. /*--------------------------------------------------------------------------*/
  83. /*          Compilation Parameters for Flexibility and Portability          */
  84.  
  85. /* modify this line to allow for machine dependencies */
  86. /*#define    SUN*/
  87. /**IMPORTANT** this is now in the in the makefile */
  88.  
  89. /* modify this line for buffered/unbuffered i/o */
  90. #define    DF_BUFFIO
  91.  
  92. /* modify this line for dynamic/static memory allocation */
  93. #define    DF_DYNAMIC
  94.  
  95. /* modify this line if structures cannot be read/written as is */
  96. #undef    DF_STRUCTOK        /* leave it this way - hdfsh expects it */
  97.  
  98. /* Current version number */
  99. #define    DFVERSION   3.00
  100.  
  101. /*--------------------------------------------------------------------------*/
  102. /*                              MT/NT constants                             */
  103. /*      four MT nibbles represent int, float, double, uchar                 */
  104. #define    DFMT_SUN        0x1111
  105. #define    DFMT_ALLIANT    0x1111
  106. #define    DFMT_IRIS4      0x1111
  107. #define DFMT_APOLLO    0x1111
  108. #define    DFMT_UNICOS     0x3331
  109. #define    DFMT_CTSS       0x3331
  110. #define    DFMT_VAX        0x2221
  111. #define    DFMT_PC         0x4144    /* note byte swapping ??? */
  112.                 /* check this... */
  113. #define    DFMT_MAC        0x1111
  114. #define DFMT_SUN386    0x1444
  115.  
  116. #define    DFNT_VERSION    1    /* current version of NT info */
  117.  
  118. /* type info codes */
  119. #define    DFNT_UINT       1
  120. #define    DFNT_INT        2
  121. #define    DFNT_UCHAR      3
  122. #define    DFNT_CHAR       4
  123. #define    DFNT_FLOAT      5
  124. #define    DFNT_DOUBLE     6
  125.  
  126. /* class info codes for int */
  127. #define    DFNTI_MBO       1    /* Motorola byte order 2's compl */
  128. #define    DFNTI_VBO       2    /* Vax byte order 2's compl */
  129. #define    DFNTI_IBO       4    /* Intel byte order 2's compl */
  130.  
  131. /* class info codes for float */
  132. #define    DFNTF_IEEE      1    /* IEEE format */
  133. #define    DFNTF_VAX       2    /* Vax format */
  134. #define    DFNTF_CRAY      3    /* Cray format */
  135. #define    DFNTF_PC        4    /* PC floats - flipped IEEE */
  136.  
  137. /* class info codes for char */
  138. #define    DFNTC_BYTE      0    /* bitwise/numeric field */
  139. #define    DFNTC_ASCII     1    /* ASCII */
  140. #define    DFNTC_EBCDIC    5    /* EBCDIC */
  141.  
  142. /* array order */
  143. #define    DFO_FORTRAN     1    /* column major order */
  144. #define    DFO_C           2    /* row major order */
  145.  
  146. /*--------------------------------------------------------------------------*/
  147. /*                      Machine dependencies                                */
  148. #ifdef PC
  149. #ifndef O_RDONLY
  150. #include <fcntl.h>
  151. #define    L_INCR  1
  152. #endif /*O_RDONLY*/
  153. typedef    int int16;
  154. typedef    unsigned int uint16;
  155. typedef    long int int32;
  156. typedef    double float32;
  157. #define    DFmovmem(from, to, len) memcpy(to, from, len)
  158. #undef DF_STRUCTOK                  /* structure writing will not work on PC */
  159. #undef DF_BUFFIO                    /* unbuffered i/o is faster */
  160. long longswap();                    /* provided elsewhere */
  161.  
  162.     /* in the next 3 lines, p is recast so right number of bytes passed */
  163.     /* ### Note that all calls modify p.  Need to use temporary ptr */
  164. #define    UINT16READ(p, x) { x = ((*p++) & 255)<<8; x |= (*p++) & 255; }
  165. #define    INT16READ(p, x) { x = (*p++)<<8; x |= (*p++) & 255; }
  166. #define    INT32READ(p, x) { x = (*p++)<<24; x|=((*p++) & 255)<<16;    \
  167.             x|=((*p++) & 255)<<8; x|=(*p++) & 255; }
  168. #define    UINT16WRITE(p, x) { *p++ = (x>>8) & 255; *p++ = x & 255; }
  169. #define    INT16WRITE(p, x) { *p++ = (x>>8) & 255; *p++ = x & 255; }
  170. #define    INT32WRITE(p, x) { *p++ = (x>>24) & 255; *p++ = (x>>16) & 255;  \
  171.             *p++ = (x>>8) & 255; *p++ = x & 255; }
  172. #define    DF_CREAT(name, prot) creat(name, prot)
  173. #define    DF_MT   DFMT_PC
  174. #endif /*PC*/
  175.  
  176.  
  177. #ifdef UNICOS
  178. #ifndef O_RDONLY
  179. #include <sys/fcntl.h>              /* for unbuffered i/o stuff */
  180. #define    L_INCR  1
  181. #endif /*O_RDONLY*/
  182. typedef    int int16;
  183. typedef    int uint16;
  184. typedef    int int32;
  185. typedef    float float32;
  186. #define    DFmovmem(from, to, len) memcpy(to, from, len)
  187. #undef DF_STRUCTOK          /* cannot directly read/write structures */
  188. #define    DF_CAPFNAMES            /* fortran names are in all caps */
  189. #define    UINT16READ(p, x)    { x = ((*p++) & 255)<<8; x |= (*p++) & 255; }
  190. #define    INT16READ(p, x)     { x = (*p++)<<8; x |= (*p++) & 255; }
  191. #define    INT32READ(p, x)     { x = (*p++)<<24; x|=((*p++) & 255)<<16;    \
  192.                                 x|=((*p++) & 255)<<8; x|=(*p++) & 255; }
  193. #define    UINT16WRITE(p, x)   { *p++ = (x>>8) & 255; *p++ = x & 255; }
  194. #define    INT16WRITE(p, x)    { *p++ = (x>>8) & 255; *p++ = x & 255; }
  195. #define    INT32WRITE(p, x)    { *p++ = (x>>24) & 255; *p++ = (x>>16) & 255;   \
  196.                                 *p++ = (x>>8) & 255; *p++ = x & 255; }
  197. #define    DF_CREAT(name, prot) creat(name, prot)
  198. #define    DF_MT   DFMT_UNICOS
  199. #endif /*UNICOS*/
  200.  
  201.  
  202. #ifdef SUN
  203. #if ! defined mc68010 && ! defined mc68020 && ! defined mc68030
  204. #undef DF_STRUCTOK
  205. #endif
  206. #include <sys/file.h>               /* for unbuffered i/o stuff */
  207. typedef    short int16;
  208. typedef    unsigned short uint16;
  209. typedef    long int32;
  210. typedef    float float32;
  211. #define    DFmovmem(from, to, len) memcpy(to, from, len)
  212. #ifndef DF_STRUCTOK
  213. #define    UINT16READ(p, x) { x = ((*p++) & 255)<<8; x |= (*p++) & 255; }
  214. #define    INT16READ(p, x) { x = (*p++)<<8; x |= (*p++) & 255; }
  215. #define    INT32READ(p, x) { x = (*p++)<<24; x|=((*p++) & 255)<<16;    \
  216.             x|=((*p++) & 255)<<8; x|=(*p++) & 255; }
  217. #define    UINT16WRITE(p, x) { *p++ = (x>>8) & 255; *p++ = x & 255; }
  218. #define    INT16WRITE(p, x) { *p++ = (x>>8) & 255; *p++ = x & 255; }
  219. #define    INT32WRITE(p, x) { *p++ = (x>>24) & 255; *p++ = (x>>16) & 255;  \
  220.             *p++ = (x>>8) & 255; *p++ = x & 255; }
  221. #endif /*DF_STRUCTOK*/
  222. #define    DF_CREAT(name, prot) creat(name, prot)
  223. #define    DF_MT   DFMT_SUN
  224. #endif /*SUN*/
  225.  
  226. #ifdef SUN386
  227. #undef DF_STRUCTOK
  228. #include <sys/file.h>               /* for unbuffered i/o stuff */
  229. typedef    short int16;
  230. typedef    unsigned short uint16;
  231. typedef    long int32;
  232. typedef    float float32;
  233. #define    DFmovmem(from, to, len) memcpy(to, from, len)
  234. #ifndef DF_STRUCTOK
  235. #define    UINT16READ(p, x) { x = ((*p++) & 255)<<8; x |= (*p++) & 255; }
  236. #define    INT16READ(p, x) { x = (*p++)<<8; x |= (*p++) & 255; }
  237. #define    INT32READ(p, x) { x = (*p++)<<24; x|=((*p++) & 255)<<16;    \
  238.             x|=((*p++) & 255)<<8; x|=(*p++) & 255; }
  239. #define    UINT16WRITE(p, x) { *p++ = (x>>8) & 255; *p++ = x & 255; }
  240. #define    INT16WRITE(p, x) { *p++ = (x>>8) & 255; *p++ = x & 255; }
  241. #define    INT32WRITE(p, x) { *p++ = (x>>24) & 255; *p++ = (x>>16) & 255;  \
  242.             *p++ = (x>>8) & 255; *p++ = x & 255; }
  243. #endif /*DF_STRUCTOK*/
  244. #define    DF_CREAT(name, prot) creat(name, prot)
  245. #define    DF_MT   DFMT_SUN386
  246. #endif /* SUN386 */
  247.  
  248. #ifdef ALLIANT
  249. #include <sys/file.h>               /* for unbuffered i/o stuff */
  250. typedef    short int16;
  251. typedef    unsigned short uint16;
  252. typedef    long int32;
  253. typedef    float float32;
  254. #define    DFmovmem(from, to, len) bcopy(from, to, len)
  255. #ifndef DF_STRUCTOK
  256. #define    UINT16READ(p, x)    { x = ((*p++) & 255)<<8; x |= (*p++) & 255; }
  257. #define    INT16READ(p, x)     { x = (*p++)<<8; x |= (*p++) & 255; }
  258. #define    INT32READ(p, x)     { x = (*p++)<<24; x|=((*p++) & 255)<<16;    \
  259.                                 x|=((*p++) & 255)<<8; x|=(*p++) & 255; }
  260. #define    UINT16WRITE(p, x)   { *p++ = (x>>8) & 255; *p++ = x & 255; }
  261. #define    INT16WRITE(p, x)    { *p++ = (x>>8) & 255; *p++ = x & 255; }
  262. #define    INT32WRITE(p, x)    { *p++ = (x>>24) & 255; *p++ = (x>>16) & 255;   \
  263.                                 *p++ = (x>>8) & 255; *p++ = x & 255; }
  264. #endif /*DF_STRUCTOK*/
  265. #define    DF_CREAT(name, prot) creat(name, prot)
  266. #define    DF_MT   DFMT_ALLIANT
  267. #endif /*ALLIANT*/
  268.  
  269.  
  270. #ifdef IRIS4
  271. #undef DF_STRUCTOK
  272. #include <sys/types.h>
  273. #include <sys/file.h>               /* for unbuffered i/o stuff */
  274. typedef    short int16;
  275. typedef    unsigned short uint16;
  276. typedef    long int32;
  277. typedef    float float32;
  278. #define    DFmovmem(from, to, len) bcopy(from, to, len)
  279. #ifndef DF_STRUCTOK
  280. #define    UINT16READ(p, x)    { x = ((*p++) & 255)<<8; x |= (*p++) & 255; }
  281. #define INT16READ(p, x)     { x = (*p++)<<8; x |= (*p++) & 255; }
  282. #define INT32READ(p, x)     { x = (*p++)<<24; x|=((*p++) & 255)<<16;    \
  283.                                 x|=((*p++) & 255)<<8; x|=(*p++) & 255; }
  284. #define UINT16WRITE(p, x)   { *p++ = (x>>8) & 255; *p++ = x & 255; }
  285. #define INT16WRITE(p, x)    { *p++ = (x>>8) & 255; *p++ = x & 255; }
  286. #define INT32WRITE(p, x)    { *p++ = (x>>24) & 255; *p++ = (x>>16) & 255;   \
  287.                                 *p++ = (x>>8) & 255; *p++ = x & 255; }
  288. #endif /*DF_STRUCTOK*/
  289. #define DF_CREAT(name, prot) creat(name, prot)
  290. #define DF_MT   DFMT_IRIS4
  291. #endif /*IRIS4*/
  292.  
  293.  
  294. #ifdef MAC
  295. #undef DF_BUFFIO        /* use unbuffered i/o */
  296. #include <memory.h>             /* malloc stuff for MPW 3.0 */
  297. #include <fcntl.h>              /* unbuffered IO stuff for MPW 3.0 */
  298. #ifdef THINK_C                  /* for LightSpeed C */
  299. #include <unix.h>
  300. #else /*THINK_C                   MPW, possibly others */
  301. #include <Files.h>              /* for unbuffered i/o stuff */
  302. #endif /*THINK_C*/
  303. #define    DF_CAPFNAMES            /* fortran names are in all caps */
  304. #define DF_DYNAMIC        /* use dynamic allocation */
  305. typedef short int16;
  306. typedef unsigned short uint16;
  307. typedef long int32;
  308. typedef float float32;
  309. #ifdef THINK_C                   /* LightSpeed C does not have memcpy */
  310. #define DFmovmem(from, to, len) DFImemcopy(from, to, len)
  311. #else /*THINK_C*/
  312. #define DFmovmem(from, to, len) memcpy(to, from, len)
  313. #endif /*THINK_C*/
  314. #define malloc(x)   NewPtr((Size)   (x))    /* don't use malloc on the Mac */
  315. #define free(x)     DisposPtr((Ptr) (x))    /* don't use free on the Nac   */ 
  316. #undef DF_STRUCTOK
  317. #define UINT16READ(p, x) { x = ((*p++) & 255)<<8; x |= (*p++) & 255; }
  318. #define INT16READ(p, x) { x = (*p++)<<8; x |= (*p++) & 255; }
  319. #define INT32READ(p, x) { x = (*p++)<<24; x|=((*p++) & 255)<<16;    \
  320.             x|=((*p++) & 255)<<8; x|=(*p++) & 255; }
  321. #define UINT16WRITE(p, x) { *p++ = (x>>8) & 255; *p++ = x & 255; }
  322. #define INT16WRITE(p, x) { *p++ = (x>>8) & 255; *p++ = x & 255; }
  323. #define INT32WRITE(p, x) { *p++ = (x>>24) & 255; *p++ = (x>>16) & 255;  \
  324.             *p++ = (x>>8) & 255; *p++ = x & 255; }
  325. #define DF_CREAT(name, prot) mopen(name, O_WRONLY|O_TRUNC|O_CREAT)
  326. #define DF_MT   DFMT_MAC
  327. #endif /*MAC*/
  328.  
  329. #ifdef VMS
  330. /*#undef DF_BUFFIO should be buff !!!!*/
  331.    /* use only unbuff i/o - buff doesn't work! */
  332. #ifndef DFopen                  /* avoid double includes */
  333. #include "dfivms.h"
  334. #endif /*DFopen*/
  335. #undef DF_STRUCTOK
  336. #define DF_CAPFNAMES            /* fortran names are in all caps */
  337. #include <file.h>               /* for unbuffered i/o stuff */
  338. typedef short int16;
  339. typedef unsigned short uint16;
  340. typedef long int32;
  341. typedef float float32;
  342. #define DFmovmem(from, to, len) memcpy(to, from, len)
  343. #ifndef DF_STRUCTOK
  344. #define UINT16READ(p, x) { x = ((*p++) & 255)<<8; x |= (*p++) & 255; }
  345. #define INT16READ(p, x) { x = (*p++)<<8; x |= (*p++) & 255; }
  346. #define INT32READ(p, x) { x = (*p++)<<24; x|=((*p++) & 255)<<16;    \
  347.             x|=((*p++) & 255)<<8; x|=(*p++) & 255; }
  348. #define UINT16WRITE(p, x) { *p++ = (x>>8) & 255; *p++ = x & 255; }
  349. #define INT16WRITE(p, x) { *p++ = (x>>8) & 255; *p++ = x & 255; }
  350. #define INT32WRITE(p, x) { *p++ = (x>>24) & 255; *p++ = (x>>16) & 255;  \
  351.             *p++ = (x>>8) & 255; *p++ = x & 255; }
  352. #endif /*DF_STRUCTOK*/
  353. #define DF_CREAT(name, prot) creat(name, prot)
  354. #define DF_MT   DFMT_VAX
  355. #endif /*VMS*/
  356.  
  357. #ifdef APOLLO
  358. #if ! defined mc68010 && ! defined mc68020 && ! defined mc68030
  359. #undef DF_STRUCTOK
  360. #endif
  361. #include <sys/file.h>               /* for unbuffered i/o stuff */
  362. #define int16 short
  363. #define uint16 unsigned short
  364. #define int32 long
  365. #define float32 float
  366. #define DFmovmem(from, to, len) memcpy(to, from, len)
  367. #ifndef DF_STRUCTOK
  368. #define UINT16READ(p, x) { x = ((*p++) & 255)<<8; x |= (*p++) & 255; }
  369. #define INT16READ(p, x) { x = (*p++)<<8; x |= (*p++) & 255; }
  370. #define INT32READ(p, x) { x = (*p++)<<24; x|=((*p++) & 255)<<16;    \
  371.             x|=((*p++) & 255)<<8; x|=(*p++) & 255; }
  372. #define UINT16WRITE(p, x) { *p++ = (x>>8) & 255; *p++ = x & 255; }
  373. #define INT16WRITE(p, x) { *p++ = (x>>8) & 255; *p++ = x & 255; }
  374. #define INT32WRITE(p, x) { *p++ = (x>>24) & 255; *p++ = (x>>16) & 255;  \
  375.             *p++ = (x>>8) & 255; *p++ = x & 255; }
  376. #endif /*DF_STRUCTOK*/
  377. #define DF_CREAT(name, prot) creat(name, prot)
  378. #define DF_MT   DFMT_APOLLO
  379. #endif /*APOLLO*/
  380.  
  381.  
  382. /*--------------------------------------------------------------------------*/
  383. /*                      Flexibility parameters                              */
  384. #ifdef MAC            /* MAC specific file manager calls */
  385. #    define DF_OPEN(x,y) mopen(x,y)
  386. #    define DF_CLOSE(x) mclose(x)
  387. #    define DF_SEEK(x,y,z) mlseek(x,y,z)
  388. #    define DF_SKEND(x,y,z) mlseek(x,-1*y,z)
  389. #    define DF_TELL(x) mlseek(x,0L,1)
  390. #    define DF_READ(a,b,c,d) mread(d,a,b*c)
  391. #    define DF_WRITE(a,b,c,d) mwrite(d,a,b*c)
  392. #    define DF_FLUSH(a)            /* no need to flush */
  393. #    define DF_RDACCESS 0        /* dummy */
  394. #    define DF_WRACCESS 0        /* dummy */
  395. #    define DF_OPENERR(f)    ((f) == -1)
  396. #else /* !MAC */
  397. #ifdef DF_BUFFIO            /* set all calls to do buffered I/O */
  398. #define DF_OPEN(x,y) fopen(x,y)
  399. #define DF_CLOSE(x) fclose(x)
  400. #define DF_SEEK(x,y,z) fseek(x,y,z)
  401. #define DF_SKEND(x,y,z) fseek(x,y,z)
  402. #define DF_TELL(x) ftell(x)
  403. #define DF_READ(a,b,c,d) fread(a,b,c,d)
  404. #define DF_WRITE(a,b,c,d) fwrite(a,b,c,d)
  405. #define DF_FLUSH(a) fflush(a)
  406. #define DF_OPENERR(f)    (!(f))
  407. #ifdef PC
  408. #define DF_RDACCESS "rb"
  409. #define DF_WRACCESS "rb+"
  410. #else /*PC*/
  411. #define DF_RDACCESS "r"
  412. #define DF_WRACCESS "r+"
  413. #endif /*PC*/
  414.  
  415. #else /*DF_BUFFIO         unbuffered i/o */
  416. #define DF_OPEN(x,y) open(x,y)
  417. #define DF_CLOSE(x) close(x)
  418. #define DF_SEEK(x,y,z) lseek(x,y,z)
  419. #define DF_SKEND(x,y,z) lseek(x,-1*y,z)
  420. #define DF_TELL(x) lseek(x,0L,1)
  421. #define DF_READ(a,b,c,d) read(d,a,b*c)
  422. #define DF_WRITE(a,b,c,d) write(d,a,b*c)
  423. #define DF_OPENERR(f)    ((f) == -1)
  424. #define DF_FLUSH(a)                             /* no need to flush */
  425. #  ifdef PC
  426. #    define DF_RDACCESS O_RDONLY | O_RAW
  427. #    define DF_WRACCESS O_RDWR | O_RAW
  428. #  else 
  429. #    define DF_RDACCESS O_RDONLY
  430. #    define DF_WRACCESS O_RDWR
  431. #  endif /*!PC*/
  432. #endif /*DF_BUFFIO*/
  433. #endif /* !MAC */
  434.  
  435.  
  436.     /* if not allocating memory dynamically, need buffer for compression */
  437. #ifndef DF_DYNAMIC
  438. #define DF_TBUF
  439. #define DF_TBUFSZ    10000    /* buffer size */
  440. #endif /*DF_DYNAMIC*/
  441.  
  442.     /* if reading/writing structures not ok, need buffer for conversion */
  443. #ifndef DF_TBUF
  444. #ifndef DF_STRUCTOK
  445. #define DF_TBUF
  446. #define DF_TBUFSZ    256    /* buffer size can be smaller */
  447. #endif /*DF_STRUCTOK*/
  448. #endif /*DF_TBUF*/
  449.  
  450.     /* set buffer size */
  451. #ifdef DF_TBUF
  452. #ifndef DFMASTER
  453. extern
  454. #endif /*DFMASTER*/
  455.     char DFtbuf[DF_TBUFSZ];
  456. #endif /*DF_TBUF*/
  457.  
  458. /* VMS str descriptor conversion macro */
  459. #if defined(VMS)
  460. #   define _fcdtocp(desc) ((char *) *((char **) &desc[4]))
  461.     typedef char *_fcd;
  462. #else /* !VMS */
  463. #if defined(UNICOS)
  464. #   include <fortran.h>
  465. #else /* !VMS && !UNICOS */
  466. #if defined(MAC)        /* with LS_FORTRAN */
  467. #   define _fcdtocp(descp) (*((char**)(descp)))
  468.     typedef char** _fcd;
  469. #else /* !VMS && !UNICOS && !MAC */
  470. #   define _fcdtocp(desc) (desc)
  471.     typedef char *_fcd;
  472. #endif
  473. #endif /* !VMS && !UNICOS */
  474. #endif /* !VMS */
  475.  
  476. /* 
  477. MACRO FCALLKEYW for any special fortran-C stub keyword
  478.  
  479. MacIntosh MPW LS-fortran needs pascal since it can interface best with
  480. pascal functions
  481. */
  482. #if defined(MAC)        /* with LS FORTRAN */
  483. #   define FCALLKEYW    pascal
  484. #else /* !MAC */
  485. #   define FCALLKEYW    /*NONE*/
  486. #endif
  487.  
  488. /*--------------------------------------------------------------------------*/
  489. /*                          Size parameters                                 */
  490. #define DF_MAXDFS           32  /* How many DF's can be open at once */
  491. #define DF_DEFAULTDDS       16  /* How many DD's a file has by default */
  492. #define DF_MAXFNLEN         256 /* maximum length of filename parameters */
  493.  
  494. #ifndef MAC
  495. char *strncpy();
  496. char *strcpy();
  497. char *malloc();
  498. char *memcpy();
  499. #endif /* !MAC */
  500.  
  501. #endif /*DF_MAGICK*/
  502.